/* 优化性能的复古游戏网站CSS */
/* Header 和 Logo 样式 */
header {
    background-color: #0c0521;
    padding: 10px 0;
    border-bottom: 4px solid #6b3bff;
    box-shadow: 0 5px 15px rgba(107, 59, 255, 0.4);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    contain: layout;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at center, rgba(107, 59, 255, 0.2) 0%, transparent 70%), 
        linear-gradient(to right, rgba(255, 0, 128, 0.1), rgba(0, 255, 255, 0.1));
    z-index: 0;
    will-change: opacity;
}

.logo {
    display: flex;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
    padding-left: 30px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
}

.logo-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ff00ff;
    box-shadow: 
        0 0 10px #ff00ff,
        0 0 20px rgba(255, 0, 255, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.logo-link:hover .logo-image {
    transform: scale(1.05);
    box-shadow: 
        0 0 15px #ff00ff,
        0 0 30px rgba(255, 0, 255, 0.7);
}

.logo h1 {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    letter-spacing: 2px;
    text-shadow: 
        2px 2px 0 #ff00ff,
        4px 4px 0 rgba(107, 59, 255, 0.7);
    transform-origin: center bottom;
    animation: textGlow 3s infinite alternate;
    will-change: text-shadow;
}

@keyframes textGlow {
    0% {
        text-shadow: 
            2px 2px 0 #ff00ff,
            4px 4px 0 rgba(107, 59, 255, 0.7),
            0 0 10px rgba(255, 255, 255, 0.5);
    }
    100% {
        text-shadow: 
            2px 2px 0 #ff00ff,
            4px 4px 0 rgba(107, 59, 255, 0.7),
            0 0 20px rgba(255, 255, 255, 0.8);
    }
}

/* 修改整体背景和文字颜色对比 */
body {
    background-color: #080215; /* 更深的背景色 */
    color: #f1eeff; /* 提高文字颜色对比度 */
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 游戏区域标题居中 */
.game-area h2 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        2px 2px 0 #ff00ff,
        4px 4px 0 rgba(107, 59, 255, 0.5);
}

/* 新的游戏网格布局 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    contain: content;
}

/* 游戏卡片样式 */
.game-card {
    display: block;
    text-decoration: none;
    background-color: #12072e;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #3b3570;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    contain: content;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: #6b3bff;
    box-shadow: 0 10px 25px rgba(107, 59, 255, 0.4);
}

.game-card:focus-visible {
    outline: 3px solid #00ff00;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(0, 255, 0, 0.5);
    transform: translateY(-5px);
}

.game-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background-color: #0c0521; /* 加载前的背景色 */
    contain: paint;
}

.game-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.game-card:hover .game-img-container img {
    transform: scale(1.05);
}

/* 喜欢计数样式 */
.game-likes {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7); /* 增加对比度 */
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 1;
}

.like-icon {
    color: #ff3e3e;
    font-size: 1rem;
}

/* 平台标签样式 */
.game-platform {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(107, 59, 255, 0.9); /* 增加对比度 */
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 1;
}

/* 游戏标题样式 */
.game-card h3 {
    padding: 12px 10px;
    margin: 0;
    font-size: 0.95rem;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 容器通用样式 */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    contain: content;
}

/* 确保游戏区域总是可见但减小顶部空间 */
.game-area {
    display: block !important;
    padding: 2rem 0;
    background-color: #111;
    background-image: 
        radial-gradient(rgba(0, 255, 0, 0.1) 2px, transparent 2px),
        radial-gradient(rgba(0, 255, 0, 0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    position: relative;
    contain: layout;
}

/* 增强 SEO 内容区域文字可见度 */
.seo-content {
    background-color: #0c0521; /* 保持原来的背景色 */
    color: #f1eeff; /* 确保文字颜色足够亮，增加对比度 */
    padding: 4rem 0;
    border-top: 2px solid #6b3bff;
    border-bottom: 2px solid #6b3bff;
    position: relative;
    contain: content;
}

.seo-what-is p, 
.seo-how-to p, 
.seo-why p, 
.feature-text p, 
.hero-text p,
.faq-answer p {
    color: #f1eeff; /* 确保所有段落文字颜色足够亮，增加对比度 */
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.seo-what-is h2, 
.seo-how-to h2, 
.seo-why h2, 
.seo-faq h2 {
    color: #ffffff; /* 确保标题文字颜色明亮 */
    margin-bottom: 2rem;
    text-align: center;
}

/* 增强页脚文字可见性 */
footer {
    background-color: #0c0521;
    padding: 3rem 0;
    color: #f1eeff; /* 增加对比度 */
    border-top: 4px solid #6b3bff;
    contain: layout;
}

/* 键盘导航优化 */
:focus {
    outline: 3px solid #00ff00; /* 更明显的焦点轮廓 */
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

:focus-visible {
    outline: 3px solid #00ff00;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(0, 255, 0, 0.5);
}

/* SEO Content Area Styles */
.seo-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(107, 59, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(107, 59, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Hero Section Styles */
.seo-hero {
    margin-bottom: 5rem;
    padding: 3rem;
    background: #12072e;
    background-image: linear-gradient(to right, rgba(107, 59, 255, 0.2), rgba(255, 215, 0, 0.1));
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 4px solid #6b3bff;
    position: relative;
    overflow: hidden;
    contain: layout;
}

.seo-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(rgba(107, 59, 255, 0.1) 9%, transparent 9%),
        radial-gradient(rgba(255, 215, 0, 0.1) 9%, transparent 9%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    opacity: 0.3;
    z-index: 0;
}

.seo-hero h2 {
    font-size: 2.2rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

.hero-content {
    display: flex;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1.3;
}

.hero-text h3 {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

.hero-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #f1eeff; /* 增加对比度 */
    margin-bottom: 1.5rem;
}

.hero-text ul {
    background-color: rgba(107, 59, 255, 0.2);
    padding: 20px 25px;
    border-radius: 10px;
    border-left: 4px solid #6b3bff;
    margin-bottom: 25px;
}

.hero-text ul li {
    font-size: 1rem;
    line-height: 1.5;
    color: #f1eeff; /* 增加对比度 */
}

.hero-image {
    flex: 1;
    position: relative;
}

.game-cover {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
    border: 4px solid #ffd700;
    transition: transform 0.3s ease;
    position: relative;
}

.game-cover:hover {
    transform: translateY(-5px);
}

.game-cover::before {
    content: "PLAY NOW";
    position: absolute;
    top: 20px;
    right: -35px;
    background: #ff3e3e;
    color: white;
    padding: 5px 40px;
    transform: rotate(45deg);
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 62, 62, 0.7);
}

.game-cover img {
    width: 100%;
    height: auto;
    display: block;
    background-color: #12072e;
    transition: transform 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.game-cover:hover img {
    transform: scale(1.03);
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: #ff3e3e;
    color: #fff;
    border: none;
    box-shadow: 0 5px 0 #bb0000, 0 5px 10px rgba(255, 62, 62, 0.4);
}

.btn-primary:hover {
    background-color: #ff5a5a;
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #bb0000, 0 8px 15px rgba(255, 62, 62, 0.4);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #bb0000, 0 3px 5px rgba(255, 62, 62, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: #ffd700;
    border: 3px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.btn-secondary:hover {
    background-color: rgba(255, 215, 0, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}

/* Feature Section Styles */
.seo-feature {
    margin-bottom: 5rem;
}

.seo-feature h2 {
    font-size: 2.2rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.feature-content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.feature-card {
    display: flex;
    gap: 3rem;
    background: #12072e;
    background-image: linear-gradient(to right, rgba(107, 59, 255, 0.2), rgba(107, 59, 255, 0.05));
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    padding: 2.5rem;
    border: 4px solid #6b3bff;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    contain: content;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.feature-card.reverse {
    flex-direction: row-reverse;
    background-image: linear-gradient(to left, rgba(107, 59, 255, 0.2), rgba(107, 59, 255, 0.05));
}

.feature-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #6b3bff, #ffd700);
    z-index: 1;
}

.feature-image {
    flex: 1;
    max-width: 40%;
    position: relative;
}

.feature-image::before {
    content: "";
    position: absolute;
    inset: -5px;
    background: linear-gradient(45deg, #6b3bff, #ffd700);
    z-index: -1;
    border-radius: 12px;
    filter: blur(10px);
    opacity: 0.5;
}

.feature-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    border: 3px solid #3b3570;
    background-color: #0c0521;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.feature-card:hover .feature-image img {
    transform: scale(1.03);
}

.feature-text {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-text h3 {
    color: #ffd700;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    position: relative;
    padding-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
}

.feature-text h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #6b3bff, transparent);
}

.feature-card.reverse .feature-text h3::after {
    background: linear-gradient(to right, transparent, #6b3bff);
}

.feature-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #f1eeff; /* 增加对比度 */
    font-size: 1.1rem;
}

/* 图片优化选择器 */
picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* 优化打印样式 */
@media print {
    .game-area {
        background: none;
        padding: 0;
    }
    
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    header, footer, .hero-buttons {
        display: none;
    }
    
    .game-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    body {
        background: #fff;
        color: #000;
    }
}

/* 响应式设计 */
@media screen and (max-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-content {
        flex-direction: column;
    }
    
    .feature-card, 
    .feature-card.reverse {
        flex-direction: column;
    }
    
    .feature-image {
        max-width: 100%;
        margin-bottom: 2rem;
    }
}

@media screen and (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* 添加省电暗模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #080215;
        color: #f1eeff;
    }
}

/* 无动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .logo h1,
    .game-area h2,
    .seo-hero h2,
    .seo-feature h2 {
        animation: none;
        text-shadow: 2px 2px 0 #ff00ff, 4px 4px 0 rgba(107, 59, 255, 0.7);
    }
    
    .game-card:hover,
    .feature-card:hover,
    .btn:hover,
    .game-cover:hover {
        transform: none;
    }
    
    .game-card:hover .game-img-container img,
    .feature-card:hover .feature-image img,
    .game-cover:hover img {
        transform: none;
    }
} 